#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <vector>

using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode(int x) : val(x), next(NULL) {}
};

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
   public:
    vector<int> exchange(vector<int>& nums) {
        int start = 0, end = nums.size() - 1;
        while (start < end) {
            while (start < nums.size() && nums[start] % 2 == 1) start++;
            while (end >= 0 && nums[end] % 2 == 0) end--;
            if (start >= end) break;
            nums[start] = nums[start] ^ nums[end];
            nums[end] = nums[start] ^ nums[end];
            nums[start] = nums[start] ^ nums[end];
        }
        return nums;
    }
};

int main() {
    cout << "Hello, World!";
    vector<int> tmp;
    tmp.push_back(1);
    tmp.push_back(3);
    tmp.push_back(5);
    Solution().exchange(tmp);
    return 0;
}